﻿using System;
using ModuloSoporte.Helpers;

namespace UI.Classes
{
    public class PluginsPage: AjaxPage
    {
        protected override string OnRequest()
        {
            string ret = string.Empty;
            try
            {
                string path = Request.PathInfo;
                try
                {
                    if (!string.IsNullOrEmpty(path))
                    {
                        /*if (path.StartsWith("/"))
                            path = path.Substring(1);

                        var plugin = HttpSingleton<IPluginService>.Instance.GetPluginByCode(path);
                        ret = plugin.DoQuery(Request.Params);*/
                    }
                }
                catch (Exception ex)
                {
                    ret = AjaxHelper.DoError(ex);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("AjaxError: " + ex.Message);
            }
            return ret;
        }
    }
}
